stabilise fn_args_density#3581
Conversation
fn_args_density passes the conditions to be made stable.|
Seems reasonable to me. My concern is its name, |
|
@topecongiro Actually sounds good to me! It reminds me of css flex so using a similar term gives a good idea of what the option does. |
|
@scampi Looks good!
|
Yes, that's the price of an unstable option. If it were stable, that'd be a totally different story! |
|
@topecongiro it has been renamed in the latest commit |
|
It keeps on failing with the error below, but locally it builds fine: |
unnecessary condition
The density parameter of items::rewrite_where_clause was used only in a conditional, which evaluated to true only if the parameter was Density::Tall.
|
Thank you for the updates! |
|
@topecongiro How soon before we could see this in a release? |
Also update the rustfmt option fn_args_density to fn_args_layout. See rust-lang/rustfmt#3581. type_alias_enum_variants is apparently now in stable, so there's no need to require it as a feature.
See rust-lang/rustfmt#3581 for background.
See rust-lang/rustfmt#3581 for background. Signed-off-by: Christopher Maier <cmaier@chef.io>
See rust-lang/rustfmt#3581 for background.
See rust-lang/rustfmt#3581 for background. Signed-off-by: Christopher Maier <cmaier@chef.io>
See rust-lang/rustfmt#3581 for background. Signed-off-by: Christopher Maier <cmaier@chef.io>
See rust-lang/rustfmt#3581 for background. Signed-off-by: Christopher Maier <cmaier@chef.io>
I think
fn_args_densitypasses the conditions to be made stable.Tallis the best compromise for formatting arguments by default:An enum
Densityis used so it is easy to add a new kind of density later if needed without breaking backward compatibility. That enum is mapped internally to another enum calledListTactic, the core logic is limited to the functionlists::definitive_tacticwhich looks clear.The enum
Densityis used to rewritewhereclauses which should probably be decoupled. However, this doesn't prevent stabilisation: it looks like it can be replaced straightforwardly by a boolean though:Plenty of time passed with rustfmt being released with that option, giving it plenty of real usage:
Verticalvariant got added 3 years ago db9d129CompressedandTallwere added 4 years ago 89cda8dIn that time frame, it got only 19 issues showing its implementation is quite stable.
Also, there are few tests about all 3 variants of
Density:None.
Close #3375